<#include "../common/header.html">

<body class="skin-blue fixed sidebar-mini" style="height: auto; min-height: 100%;">
<div class="wrapper" style="height: auto; min-height: 100%;">
    <#assign page_tab="article">
    <#assign page_nav="articlelist">
    <#include "content_menu.html">

    <!--右侧内容 开始-->
    <div id="admin_right" class="content-wrapper">
        <div class="breadcrumbs" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="home-icon fa fa-home"></i>
                    <a href="/system/index">工具</a>
                </li>
                <li>
                    <a href="/system/article/article_list">文章管理</a>
                </li>
                <li class="active">文章列表</li>
            </ul>
        </div>
        <@fly_articlepage p="${p}">
        <div class="content">
            <form action="#" method="post" name="article">
                <table class="table list-table">
                    <colgroup>
                        <col width="35px" />
                        <col width="250px" />
                        <col width="100px" />
                        <col width="150px" />
                        <col width="180px" />
                        <col width="60px" />
                        <col width="60px" />
                        <col width="110px" />
                    </colgroup>
                    <caption>
                        <a class="btn btn-default" href='/admin/article/article_add'>
                            <i class="fa fa-plus"></i>添加文章
                        </a>
                        <a class="btn btn-default" id="selectAll">
                            <i class="fa fa-check"></i>全选
                        </a>
                        <a class="btn btn-default" id="indexAllarticle">
                            <i class="fa fa-book"></i>全部索引
                        </a>
                        <a class="btn btn-default">
                            <i class="fa fa-close"></i>批量删除
                        </a>
                    </caption>
                    <thead>
                    <tr>
                        <th></th>
                        <th width="400px">标题</th>
                        <th>文章分类</th>
                        <th>推荐</th>
                        <th>发布时间</th>
                        <th>审核</th>
                        <th width="300px">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#list article_page.list as list>
                    <tr>
                        <td><input type="checkbox" name="id" value="7" /></td>
                        <td><a target="_blank" href='/article/${list.id!}' title='查看'><span style="">${list.title!}</span></a></td>
                        <td><@fly_articletypeinfo id="${list.typeId}"><#if type??>${type.name!}<#else>未选择分类</#if></@fly_articletypeinfo></td>
                        <td class="center">
                            <#if list.recommend == 0>
                            <span class="pull-right-container">
                                <small class="label label-default">不推荐</small>
                            </span>
                            <#elseif list.recommend == 1>
                            <span class="pull-right-container">
                                <small class="label bg-yellow">内容页推荐</small>
                            </span>
                            <#elseif list.recommend == 2>
                            <span class="pull-right-container">
                                <small class="label bg-aqua">栏目页推荐</small>
                            </span>
                            <#elseif list.recommend == 3>
                            <span class="pull-right-container">
                                <small class="label bg-light-blue">专题页推荐</small>
                            </span>
                            <#elseif list.recommend == 4>
                            <span class="pull-right-container">
                                <small class="label bg-green">首页推荐</small>
                            </span>
                            <#elseif list.recommend == 5>
                            <span class="pull-right-container">
                                <small class="label label-danger">全站推荐</small>
                            </span>
                            </#if>
                        </td>
                        <td>${list.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
                        <td>
                            <#if list.status == 0>
                            未审核
                            <#elseif list.status == 1>
                            正常
                            <#elseif list.status == 2>
                            未通过
                            <#elseif list.status == 3>
                            已删除
                            </#if>
                        </td>
                        <td>
                            <a class="article-status" data-id="${list.id}" data-toggle="modal" data-target="#statusModal"><i class='fa fa-cog'></i>审核 </a>
                            <a href='/admin/article/article_edit/id/${list.id}'><i class='fa fa-edit'></i>编辑 </a>
                            <a data-title="${list.title!}" data-id="${list.id!}" class="article-delete"><i class='fa fa-close'></i>删除 </a>
                        </td>
                    </tr>
                    </#list>
                    </tbody>
                </table>
                <div class="text-center">
                    <ul class="pagination">
                        ${article_page.pageNumHtml}
                    </ul>
                </div>
            </form>
        </div>
        </@fly_articlepage>
    </div>
    <!--右侧内容 结束-->
</div>
<div class="modal fade" id="statusModal" tabindex="-1" role="dialog" aria-labelledby="statusModalLabel" aria-hidden="true">>
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">审核</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="status0" class="control-label">状态</label>
                        <p>
                            <label class="radio-inline">
                                <input type="radio" name="status" id="status0" value="0">
                                未审核
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" id="status1" value="1">
                                正常
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" id="status2" value="2">
                                未通过
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" id="status3" value="3">
                                删除
                            </label>
                        </p>
                    </div>
                    <div class="form-group">
                        <label for="recommend" class="control-label">推荐设置</label>
                        <select name="recommend" class="form-control" id="recommend">
                            <option value="0">不推荐</option>
                            <option value="1">内容页推荐</option>
                            <option value="2">栏目页推荐</option>
                            <option value="3">专题页推荐</option>
                            <option value="4">首页推荐</option>
                            <option value="5">全站推荐</option>
                        </select>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <input name="id" id="id" value="" type="hidden">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary article-status-btn" data-dismiss="modal">保存</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script type="text/javascript">seajs.use('content', function(content) {});</script>
</body>
</html>